Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust: Unused variable follow-up work #17744

Merged
merged 1 commit into from
Oct 14, 2024
Merged

Conversation

geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented Oct 11, 2024

Changes to unused variable.

@geoffw0 geoffw0 added the Rust Pull requests that update Rust code label Oct 11, 2024
@geoffw0 geoffw0 changed the title Rust: Unused variable work Rust: Unused variable follow-up work Oct 11, 2024
hvitved
hvitved previously approved these changes Oct 11, 2024
@geoffw0
Copy link
Contributor Author

geoffw0 commented Oct 12, 2024

DCA shows we still get 472,005 results for rust/unused-variable. It's a bit less than we the last time we ran without the workaround (not counting the project that was added since then), but something clearly still isn't right. I'll investigate on Monday.

@geoffw0
Copy link
Contributor Author

geoffw0 commented Oct 14, 2024

I've removed the second commit (force push) because we're clearly not quite there yet. This PR is not just correcting the test annotations.

@geoffw0 geoffw0 marked this pull request as ready for review October 14, 2024 11:08
Copy link
Contributor

@paldepind paldepind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a nitpick comment, but otherwise it looks good to me :)

@@ -111,7 +111,7 @@ fn arrays() {

println!("lets use {:?}", js);

for k // SPURIOUS: unused variable [macros not yet supported]
for k
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that the comment is no longer there, it might be nicer to remove the linebreak before in (in all three cases)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the idea of changing formatting around just because query results change. If it was correct to split the for loop into two lines before (so that any results on k or ks are clearer), it's still justified now IMO.

I'm admittedly not an unbiased source as changing this would require me to fix up a couple of other commits I have ready. If you don't agree with my justification, say so and I'll make the change after all my work on this is merged.

@geoffw0 geoffw0 merged commit 25b592f into github:main Oct 14, 2024
12 checks passed
@geoffw0 geoffw0 deleted the unusedvar5 branch October 29, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rust Pull requests that update Rust code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants